<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ConsoleColor</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">ConsoleColor()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>ConsoleColor</b></font>(CharacterColor, BackgroundColor)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>

更改用来显示文本的颜色。调用此函数后控制台上打印的所有字符都将使用您新指定的颜色。 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>CharacterColor</i></td>
<td width="90%"> 
此颜色用于字符。颜色范围在0-15,控制台模式下只有16种颜色有效:： 
<pre><font face="Courier New, Courier, mono"size="2">  0 - Black (default background)
  1 - 蓝色
  2 - 绿色
  3 - Cyan
  4 - 红色
  5 - Magenta
  6 - Brown
  7 - Light grey (default foreground)
  8 - Dark grey
  9 - Bright blue
  10 - Bright green
  11 - Bright cyan
  12 - Bright red
  13 - Bright magenta
  14 - 黄色
  15 - 白色
</font></pre>

</td></tr>
<tr><td><i>BackgroundColor</i></td>
<td> 
 
The color for the character background. The values are the same as for the CharacterColor. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenConsole</font>()
    <b><font color="#3A3966">For</font></b> Foreground = 0 <b><font color="#3A3966">To</font></b> 15
      <b><font color="#3A3966">For</font></b> Background = 0 <b><font color="#3A3966">To</font></b> 15
<font color="#3A3966">        ConsoleColor</font>(Foreground, Background)
<font color="#3A3966">        Print</font>(<font color="#3A3966">Right</font>(<font color="#3A3966">Hex</font>(Background), 1))
      <b><font color="#3A3966">Next</font></b>
        
<font color="#3A3966">      PrintN</font>("")
    <b><font color="#3A3966">Next</font></b>
    
<font color="#3A3966">    ConsoleColor</font>(7, 0)
<font color="#3A3966">    PrintN</font>("Press return to exit")
<font color="#3A3966">    Input</font>()
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>
<p><img src="../HelpPictures/consolecolor.png"></p>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="enablegraphicalconsole.html">EnableGraphicalConsole()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>Windows</Blockquote></p><center>&lt;- <a href=closeconsole.html>CloseConsole()</a> - <a href="index.html">Console 索引</a> - <a href="consolecursor.html">ConsoleCursor()</a> -&gt;<br><br>

</body></html>